package com.tcenter.dao.entities;


import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * 
 */
@Entity
@Table(name = "lecturer", catalog = "tcenterdb")
@PrimaryKeyJoinColumn(name = "id")
public class Lecturer extends User implements java.io.Serializable {

    private String position;
    private Group group;
    private Set<Course> courses = new HashSet<Course>(0);
    

    public Lecturer() {
    }

    public Lecturer(String firstName, String secondName, String position) {
        super(firstName, secondName);
        this.position = position;
    }


    @Column(name = "position")
    public String getPosition() {
        return this.position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "lecturer")
    public Set<Course> getCourses() {
        return this.courses;
    }

    public void setCourses(Set<Course> courses) {
        this.courses = courses;
    }

    @OneToOne(fetch = FetchType.LAZY, mappedBy = "lecturer")
    public Group getGroup() {
        return this.group;
    }

    public void setGroup(Group group) {
        this.group = group;
    }

}
